define(["jquery", "admin_base"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'curd.index/index',
        add_url: 'curd.index/add',
        edit_url: 'curd.index/edit',
        delete_url: 'curd.index/delete',
        modify_url: 'curd.index/modify',
        export_url: 'curd.index/export',
        password_url: 'curd.index/password',
    };

    var Controller = {

        index: function () {

            ea.table.render({
                init: init,
                cols: [[
                    { type: "checkbox" },
                    { field: 'id', width: 80, title: 'ID' },
                    { field: 'admin_id', width: 80, title: '管理员', edit: 'text',templet:function(d){
                        return d.admin.username
                    } },
                    { field: 'post_json', minWidth: 80, title: 'json' },
                    { field: 'curd', minWidth: 80, title: 'curd' },
                    { field: 'create_time', minWidth: 80, title: '创建时间', search: 'range' },
                    {
                        width: 250,
                        title: '操作',
                        templet: ea.table.tool,
                        operat: ['delete']
                    }
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        }
    };
    return Controller;
});